<?php

namespace Gds\VenteBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class BonLivraisonRetourClientType extends AbstractType {

    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
                ->add('date', 'date', array('widget' => 'single_text', 'format' => 'dd/MM/yyyy'))
                ->add('reference')
                ->add('client')
                ->add('lignesBonLivraisonRetours', 'collection', array('type' => new LigneBonLivraisonRetourClientType(),
                    'allow_add' => true,
                    'allow_delete' => true,
                    'by_reference' => false));
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'Gds\VenteBundle\Entity\BonLivraisonRetourClient'
        ));
    }

    public function getName() {
        return 'gds_ventebundle_bonlivraisonretourclienttype';
    }

}
